﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Majoopic.DataAccess.Model;

namespace Majoopic.Service.Interface
{
    /// <summary>
    /// Service to manage the device connected to the library
    /// </summary>
    public interface IDeviceService
    {
        /// <summary>
        /// Get the device by its name
        /// </summary>
        /// <param name="deviceName">Name of the device</param>
        /// <returns>The found device or null</returns>
        Device GetDeviceByName(string deviceName);

        /// <summary>
        /// Get all the devices in the database
        /// </summary>
        /// <returns>List of the device registered</returns>
        ICollection<Device> GetAllDevices();

        /// <summary>
        /// Add a device to the library
        /// </summary>
        /// <param name="deviceName">Name of the device</param>
        /// <returns>The new device instance</returns>
        Device AddDevice(string deviceName);

        /// <summary>
        /// Get the device by its name or register it if is not in the database
        /// </summary>
        /// <param name="deviceName">Name of the device</param>
        /// <returns>The device instance</returns>
        Device GetOrRegisterDevice(string deviceName);
    }
}
